﻿using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;

namespace Entity;

/// <summary>
/// 
/// </summary>
public class Store : MoneyBaseEntity
{
    /// <summary>
    /// 商户名
    /// </summary>
    [Required(ErrorMessage = "请输入门店名")]
    public string? Name { get; set; }

    /// <summary>
    /// 0审核中 1正常 2审核驳回  3禁用
    /// </summary>
    public int State { get; set; }

    /// <summary>
    /// 
    /// </summary>
    [Required(ErrorMessage = "请输入联系电话")]
    public string? Phone { get; set; }

    /// <summary>
    /// 
    /// </summary>
    [Required(ErrorMessage = "请上传店铺图")]
    public string? Avatar { get; set; }

    /// <summary>
    /// 
    /// </summary>
    [Required(ErrorMessage = "请选择地址")]
    public string? Province { get; set; }

    /// <summary>
    /// 
    /// </summary>
    [Required(ErrorMessage = "请选择地址")]
    public string? City { get; set; }

    /// <summary>
    /// 
    /// </summary>
    [Required(ErrorMessage = "请选择地址")]
    public string? Area { get; set; }

    /// <summary>
    /// 
    /// </summary>
    [Required(ErrorMessage = "请输入详细地址")]
    public string? Address { get; set; }

    /// <summary>
    /// 纬度
    /// </summary>
    public double Lat { get; set; }

    /// <summary>
    /// 经度
    /// </summary>
    public double Lng { get; set; }

    /// <summary>
    /// 推广代理
    /// </summary>
    public int ProxyId { get; set; }

    /// <summary>
    /// 密码
    /// </summary>
    [JsonIgnore]
    public string? Pwd { get; set; } = "123456";

    /// <summary>
    /// 代理商信息
    /// </summary>
    [Navigate(NavigateType.OneToOne, nameof(ProxyId))]
    public Entity.Proxy? ProxyInfo { get; set; }

}






/// <summary>
/// 商户基类
/// </summary>
public class BaseStoreEntity : BaseEntity
{
    /// <summary>
    /// 商户编号
    /// </summary>
    public int StoreId { get; set; }
}

